package com.d0325;

import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

public class TestMassageFormat2 {
    public static void main(String[] args) {
        try {
            FileReader fr = new FileReader("src//com//d0325//message.properties");
            Properties properties = new Properties();
            properties.load(fr);
            String pattern=properties.getProperty("pattern");
            System.out.println(MessageFormat.format(pattern,new Object[]{"Alice", 134.8}));
            System.out.println(MessageFormat.format(pattern, new Object[]{"Lily", 4334.8}));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}